home *** CD-ROM | disk | FTP | other *** search
/ Champak Vol C-14 / Vol C-14.iso / games / keepy_up.swf / scripts / DefineSprite_49 / frame_6 / DoAction.as
Text File  |  2012-04-23  |  1KB  |  49 lines

  1. t = Number(t) + 0.1;
  2. oldx = x;
  3. oldy = y;
  4. x = getProperty("Ball", _X);
  5. y = getProperty("Ball", _Y);
  6. vy = Number(vy) + Number(g / 10);
  7. x = Number(x) + Number(vx / 10);
  8. y = Number(y) + Number(vy / 10);
  9. if(Number(y) < Number(BallRadius))
  10. {
  11.    y = BallRadius;
  12.    vx *= elastic;
  13.    vy = - vy * elastic;
  14. }
  15. if(Number(270 - BallRadius) < Number(y))
  16. {
  17.    if(Number(kicked) == 1)
  18.    {
  19.       kicked = 0;
  20.       if(Number(bestscore) < Number(score))
  21.       {
  22.          bestscore = score;
  23.          set("../score/:my_score",bestscore);
  24.       }
  25.       lastscore = score;
  26.       score = 0;
  27.    }
  28.    y = 270 - BallRadius;
  29.    vx *= elastic;
  30.    vy = - vy * elastic;
  31. }
  32. if(Number(x) < Number(BallRadius + 20))
  33. {
  34.    x = BallRadius + 20;
  35.    vx = - vx * elastic;
  36.    vy *= elastic;
  37. }
  38. if(Number(385 - BallRadius) < Number(x))
  39. {
  40.    x = 385 - BallRadius;
  41.    vx = - vx * elastic;
  42.    vy *= elastic;
  43. }
  44. setProperty("Ball", _X, x);
  45. setProperty("Ball", _Y, y);
  46. setProperty("Ball", _rotation, x);
  47. setProperty("Ball", _xscale, 100);
  48. setProperty("Ball", _yscale, 100);
  49.